package com.delamer.facile.order;

import java.util.ArrayList;
import java.util.List;

public class OrderBase {
    private final List<String[]> commands = new ArrayList<String[]>() {{
        add(new String[]{"enderchest"});
        add(new String[]{"ec"});
        add(new String[]{"workbench"});
        add(new String[]{"wb"});
        add(new String[]{"fly"});
        add(new String[]{"heal"});
        add(new String[]{"suicide"});
        add(new String[]{"back"});
        add(new String[]{"palette"});
        add(new String[]{"enderchest_see"});
        add(new String[]{"inventory_see"});
        add(new String[]{"hat"});
        add(new String[]{"quest"});
        add(new String[]{"nick"});
        add(new String[]{"broadcast"});
        add(new String[]{"bc"});
    }};

    public String get(String order) {
        if (order == null || order.equals(""))
            return null;
        for (String[] commands : commands)
            for (String command : commands)
                if (order.equalsIgnoreCase(command))
                    return commands[0];
        return null;
    }

    public String[] getAll() {
        String result = "";
        for (String[] command : commands)
            result = result + command[0] + ",";
        return result.split(",");
    }
}
